<?php
namespace app\facade;

use think\Facade;
use think\facade\Config;
use app\services\ai\AiInterface;
use app\services\ai\Qq;
use app\services\ai\Youtu;
use app\services\ai\Baidu;

class Ai extends Facade
{
    const BAIDU = 'Baidu';
    const QQ = 'Qq';
    const YOUTU = 'Youtu';

    protected static function getFacadeClass()
    {
        switch (Config::get('ai.driver')) {
            case self::QQ :
                bind(AiInterface::class, new Qq(config('ai.qq')));
                break;
            case self::YOUTU :
                bind(AiInterface::class, new Youtu(config('ai.youtu')));
                break;
            default :
                bind(AiInterface::class, new Baidu(config('ai.baidu')));
                break;
        }

        return AiInterface::class;
    }
}
